#include<iostream>
#include<unordered_map>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
	string s = "dcba";
	string ss;
	char* str =  sort(s.begin(), s.end());
	return 0;
}

class Solution {
public:
    vector<vector<string>> groupAnagrams(vector<string>& strs) {
        if (!strs.size()) return { {} };
        unordered_map<string, vector<string>> hash;

        for (int i = 0; i < strs.size(); i++)
        {
            string s = strs[i];
            sort(s.begin(), s.end());
            hash[s].push_back(strs[i]);
        }

        vector<vector<string>> ret;
        for (auto e : hash)
        {
            ret.push_back(e.second);
        }
        return ret;
    }
};